home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
prtgrid
/
prtdemo.frm
< prev
next >
Wrap
Text File
|
1995-09-06
|
3KB
|
123 lines
VERSION 2.00
Begin Form frmMain
BorderStyle = 1 'Fixed Single
Caption = "PrintGrid Demo"
ClientHeight = 4035
ClientLeft = 2115
ClientTop = 1995
ClientWidth = 4635
Height = 4725
Icon = PRTDEMO.FRX:0000
Left = 2055
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4035
ScaleWidth = 4635
Top = 1365
Width = 4755
Begin Grid grdDemo
Cols = 5
Height = 3375
Left = 180
Rows = 15
TabIndex = 0
Top = 180
Width = 4275
End
Begin Label lbl1
Caption = "Press Ctrl+P to Print"
Height = 195
Left = 180
TabIndex = 1
Top = 3660
Width = 1875
End
Begin Menu mnuFile
Caption = "&File"
Begin Menu mnuFilePrint
Caption = "&Print"
Shortcut = ^P
End
Begin Menu mnuFileSep1
Caption = "-"
End
Begin Menu mnuFileExit
Caption = "E&xit"
End
End
Begin Menu mnuFileAbout
Caption = "&About"
Begin Menu mnuAboutText
Caption = " "
Index = 0
End
Begin Menu mnuAboutText
Caption = "Distributed Freely by"
Index = 1
End
Begin Menu mnuAboutText
Caption = "New Leaf Software"
Index = 2
End
Begin Menu mnuAboutText
Caption = "(New Leaf@aol.com)"
Index = 3
End
Begin Menu mnuAboutText
Caption = " "
Index = 4
End
End
End
Option Explicit
Sub Form_Load ()
Dim RowIndex As Integer
Dim ColIndex As Integer
' populate grid with sample data
For RowIndex = 0 To grdDemo.Rows - 1
grdDemo.Row = RowIndex
For ColIndex = 0 To grdDemo.Cols - 1
grdDemo.Col = ColIndex
grdDemo.Text = String$(RowIndex + 1, Right(ColIndex, 1)) & " " & String$(RowIndex + 1, Right(ColIndex, 1))
Next
Next
End Sub
Sub mnuFileExit_Click ()
Unload Me
End Sub
Sub mnuFilePrint_Click ()
'
' initialize PageInfo prior to calling PrintGrid
'
' 1440 twips = 1 inch
PageInfo.Margin = 1440
' must be a Printer supported font (TrueType works best)
PageInfo.FontName = "Arial"
PageInfo.FontSize = 10
PageInfo.FontBold = True
PageInfo.FontItalic = False
' shading for fixed rows/cols: 0 (none) to 255 (black)
PageInfo.FixedShade = 224
Screen.MousePointer = 11
PrintGrid grdDemo
Screen.MousePointer = 0
End Sub